package com.tiyende.credit.loop.ui.adapter

import androidx.recyclerview.widget.RecyclerView
import com.lib.common.adapter.CommonRecyclerViewAdapter
import com.lib.common.adapter.CommonViewHolderHelper
import com.tiyende.credit.loop.R
import com.tiyende.credit.loop.utils.TiyendeImageUtil
import org.json.JSONObject

/**
 * TiyendeCredit
 * @Author wwdeng
 * @CreateTime: 2024/11/25 11:51
 * @Annotation：贷款详情 - 账户列表
 */
class TIyendeOrderInfoAccountAdapter(recyclerView: RecyclerView?) : CommonRecyclerViewAdapter<JSONObject>(recyclerView, R.layout.tiyende_activity_order_info_account_item) {
    override fun setItemChildListener(helper: CommonViewHolderHelper, viewType: Int) {
    }
    override fun fillData(helper: CommonViewHolderHelper, position: Int, model: JSONObject) {
        var showName = model.optString("name","")
        if (showName.isEmpty() || showName == "null"){
            showName = "test"
        }
        helper.setText(R.id.textTitle,showName)
        helper.setText(R.id.textNumber,"+" + model.optString("account"))
        val imgLogo = helper.getImageView(R.id.imgLogo)
        TiyendeImageUtil.instance?.loadImageUrl(mContext,imgLogo,model.optString("logo"), R.mipmap.tiyende_holder)
    }
}